<template>
  <div>
    <el-dialog
      title="操作确认"
      :visible.sync="dialogVisible"
      @close="dialogVisibleClose"
      lock-scroll
      width="28%"
    >
      <div class="dialog_div_new">
        <div class="dialog_middle">
          <svg-icon
            class="svg_icon"
            :icon-class="tipsData.tipsState == 'delete' ? 'prompt_red' : 'prompt_blue'"
          ></svg-icon>
          <div>
            <p v-html="tipsData.tipsWords"></p>
          </div>
        </div>
        <div class="dialog_bottom">
          <el-button @click.stop="dialogVisible = false">否</el-button>
          <el-button type="primary" @click.stop="onConfirm">是</el-button>
        </div>
      </div>
    </el-dialog>
  </div>
</template>

<script>
export default {
  props: {
    tipsData: Object,
  },
  data () {
    return {
      dialogVisible: false,
      state: false,
    }
  },
  methods: {
    onConfirm () {
      this.dialogVisible = !this.dialogVisible
      this.state = true
    },
    dialogVisibleClose () {
      this.$emit('dialogVisibleClose', this.state)
      this.state = false
    },
  },
}
</script>

<style lang="scss" scoped>
::v-deep .el-dialog {
  margin-top: 33vh !important;
  border-radius: 0.187512rem;
  overflow: hidden;
  .el-dialog__body {
    padding: 0;
  }
  .el-dialog__header {
    width: 100%;
    height: 0.937559rem;
    box-sizing: border-box;
    padding: 0 0.375023rem;
    border-bottom: 1px solid #eeeeee;
    display: flex;
    align-items: center;
    justify-content: space-between;
    span {
      font-size: 0.300019rem;
      color: #666;
      font-weight: 600;
    }
    .el-dialog__headerbtn {
      position: static;
      .el-icon-close {
        color: #999;
        font-size: 0.48753rem;
      }
    }
  }
}
.dialog_div_new {
  width: 100%;
  height: 25vh;
  overflow: auto;
  background: #fff;
  .dialog_middle {
    width: 100%;
    height: calc(100% - 1.12507rem - 0.281268rem);
    box-sizing: border-box;
    padding: 0 0.843803rem 0 0.937559rem;
    margin-top: 0.281268rem;
    display: flex;
    align-items: center;
    overflow: auto;
    .svg_icon {
      width: 0.787549rem;
      height: 0.787549rem;
      margin-top: -0.093756rem;
    }
    div {
      width: calc(100% - 0.787549rem);
      margin-left: 0.468779rem;
      box-sizing: border-box;
      p {
        width: 100%;
        font-size: 0.262516rem;
        font-family: PingFang SC;
        font-weight: 400;
        line-height: 0.412526rem;
        color: #666666;
        margin: 0;
      }
    }
  }
  .dialog_bottom {
    width: 100%;
    height: 1.12507rem;
    box-sizing: border-box;
    padding: 0 0.187512rem;
    display: flex;
    align-items: center;
    justify-content: center;
    ::v-deep .el-button {
      width: 1.12507rem;
      height: 0.562535rem;
      text-align: center;
      box-sizing: border-box;
      display: flex;
      align-items: center;
      justify-content: center;
      font-size: 0.225014rem;
      border-radius: 0.093756rem;
      background: #fff;
      border: 1px solid #dddddd;
      color: #666666;
    }
    ::v-deep .el-button--primary {
      background: #1890ff;
      border-color: #1890ff;
      color: #fff;
      margin-left: 0.112507rem;
    }
    ::v-deep .el-button--default {
      margin-right: 0.112507rem;
    }
  }
}
</style>